import { View } from "../../../mvc/core/View";
import { ObjCreate } from "./ObjCreate";
import { ImagesConst } from "../../resource/ImagesConst";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { Language } from "../../../../extend/language/Language";
import { GTextFormat } from "../../../common/GTextFormat";
import { FontUtil } from "../../../common/font/FontUtil";
import { LoaderManager } from "../../../../com/gengine/resource/LoaderManager";
import { ImageInfo } from "../../../../com/gengine/resource/info/ImageInfo";
import { LayerManager } from "../../manager/LayerManager";
import { EffectManager } from "../../manager/EffectManager";
import { KeyBoardManager } from "../../../../com/gengine/keyBoard/KeyBoardManager";
import { BrowerManager } from "../../../../com/gengine/manager/BrowerManager";
type int = number;
//class KillUserView
    
    export  class KillUserView extends View
    {
        constructor()
        {
            super();
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            this._avatar = new Object /* flash.display.Bitmap */();
            this.addChild(this._avatar);
            ObjCreate.createBg(110, 45, 329, 150, this, ImagesConst.KillUserBg);
            ObjCreate.createBg(115, 160, 320, 2, this, ImagesConst.KillUserLine);
            this._tipTxt = ObjCreate.createTextField("", 140, 50, 290, 135, this);
            this._tipTxt.autoSize = flash.text.TextFieldAutoSize.LEFT;
            this._tipTxt.multiline = true;
            this._tipTxt.htmlText = "<textFormat leading=\'5\'>" + HTMLUtil.addColor(Language.getString(10008), "#ffffff") + "</textFormat>";
            this._contentTxt = ObjCreate.createTextField("", 140, 105, 290, 135, this, new GTextFormat(FontUtil.songtiName, 12, 16777215));
            this._contentTxt.multiline = true;
            this._reLoginTxt = ObjCreate.createTextField("", 315, 170, 220, 30, this, new GTextFormat(FontUtil.songtiName, 16, 6350622));
            this._reLoginTxt.htmlText = "<a href=\'event: 1\'>" + Language.getString(10009) + "</a>";
            this._reLoginTxt.addEventListener(flash.events.TextEvent.LINK, this.onReloadClickHandler);
            LoaderManager.instance.load("zhiyin.png", this.onAvatarLoaded);
            return;
        }

        /* internal  */getErrorStrByType(arg1: int): string
        {
            var loc2=null;
            var loc1=Language.getArray(10007);
            var loc3=0;
            while (loc3 < loc1.length) 
            {
                loc2 = loc1[loc3];
                if (loc2.name == arg1.toString()) 
                {
                    return loc2.label;
                }
                ++loc3;
            }
            return "";
        }

        public updateContentByType(arg1: int): void
        {
            var loc1=this.getErrorStrByType(arg1);
            var loc2=Language.getString(10006);
            this._contentTxt.htmlText = "<textFormat leading=\'5\'>" + HTMLUtil.addColor(loc1, "#f0ea3f") + loc2 + "</textFormat>";
            return;
        }

        /* internal  */onAvatarLoaded(arg1: ImageInfo): void
        {
            this._avatar.bitmapData = arg1.bitmapData;
            return;
        }

        public /* override */ hide(): void
        {
            LayerManager.highestLayer.removePopup(this);
            return;
        }

        public /* override */ show(arg1: int=0, arg2: int=0): void
        {
            LayerManager.highestLayer.addPopUp(this, true);
            LayerManager.highestLayer.centerPopup(this);
            EffectManager.addUIMask([], 0);
            KeyBoardManager.instance.cancelListener();
            return;
        }

        /* internal  */onReloadClickHandler(arg1: Object /* flash.events.TextEvent */): void
        {
            BrowerManager.instance.reload();
            return;
        }

        /* internal */ /* var */_avatar: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_bg: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_line: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_tipTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_contentTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_reLoginTxt: Object /* flash.text.TextField */;
    }
